import func.overlord.client as fc
import simplejson as json
from whale.plugins.Plugin import Plugin

##from psycopg2.extensions import adapt
##import sys

'''
Created on Apr 29, 2012

@author: talamoig
'''

class Func(Plugin):

    def __init__(self):
        '''
        Constructor
        '''
        None
        
    def funcclientsname(self,hostexp="*"):
        return self.funcclients("*%s*"%hostexp).list_minions()

    def funcclients(self,hostexp):
        return fc.Client(hostexp)
        
    def runcommand(self,hostexp,command):
        return self.funcclients(hostexp).command.run(command)
